/**
 * This file is part of 1genia trampoline
 * Copyright (C) 2007-2008 1genia (contact@1genia.com)
 *
 * This library is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; version 3 of the License. 
 *
 * This library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details. 
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; see the file COPYING.TXT.  If not,
 * write to the Free Software Foundation, Inc., 51 Franklin Street,
 * Fifth Floor, Boston, MA 02110-1301, USA. 
 **/
package com.genia.toolbox.projects.toolbox_basics_project.bean.impl;

import java.util.HashMap;
import java.util.Locale;
import java.util.Map;

import com.genia.toolbox.projects.toolbox_basics_project.bean.TemplateDescriptor;

/**
 * implementation of {@link TemplateDescriptor}.
 */
public class TemplateDescriptorImpl
    extends AbstractTemplateDescriptor
    implements TemplateDescriptor
{

  /**
   * the identifier of the parent of the template described.
   */
  private String parentReferenceName;

  /**
   * the name of the template in the different languages.
   */
  private Map<Locale, String> names = new HashMap<Locale, String>();



  /**
   * add a new name for the given locale.
   * 
   * @param locale
   *          the name of the {@link  java.util.Locale} of the element to add
   * @param name
   *          the name associated to the given locale
   */
  public void addName(Locale locale, String name)
  {
    getNames().put(locale, name);
  }



  /**
   * getter for the names property.
   * 
   * @return the names
   */
  public Map<Locale, String> getNames()
  {
    return names;
  }



  /**
   * getter for the parentReferenceName property.
   * 
   * @return the parentReferenceName
   */
  public String getParentReferenceName()
  {
    return parentReferenceName;
  }



  /**
   * setter for the names property.
   * 
   * @param names
   *          the names to set
   */
  public void setNames(Map<Locale, String> names)
  {
    this.names = names;
  }



  /**
   * setter for the parentReferenceName property.
   * 
   * @param parentReferenceName
   *          the parentReferenceName to set
   */
  public void setParentReferenceName(String parentReferenceName)
  {
    this.parentReferenceName = parentReferenceName;
  }

}
